
public class DuckSimulator {
	public static void main(String[] args){
		DuckSimulator sim = new DuckSimulator();
		AbstractDuckFactory duckFactory = new CountingDuckFactory();
		sim.simulate(duckFactory);
	}
	
	void simulate(AbstractDuckFactory duckFactory){
		Quackable mallardDuck = duckFactory.createMallardDuck();
		Quackable redHeadDuck = duckFactory.createRedHeadDuck();
		Quackable duckCall= duckFactory.createDuckCall();
		Quackable rubberDuck = duckFactory.createRubberDuck();
		
		Quackable gooseDuck = new GooseAdaptor(new Goose());
		
		System.out.println("\nDuck Sim #4 How may time Quacks? Using CountingFactory");
		
		simulate(mallardDuck);
		simulate(redHeadDuck);
		simulate(duckCall);
		simulate(rubberDuck);
		simulate(gooseDuck);
		
		System.out.println("\nThs Ducks Quacked " + QuackCounter.getQuacks() + " Times");
	}
	
	void simulate( Quackable duck){
		duck.Quack();
	}
	

}
